#ifndef CHATDIALOG_H
#define CHATDIALOG_H

#include <QtGui>
#include "ui_ChatDialog.h"
#include "MessageEdit.h"
#include "ArticleWidget.h"
#include "lib/bbs.h"
#include "lib/profile.h"

class ChatDialog : public QMainWindow , public Ui::ChatDialog{
    Q_OBJECT
    public:
	ChatDialog( Board * newBoard ,  QWidget * parent = 0);
	void closeEvent(QCloseEvent * event);
    private :
	void writeSettings();
	void readSettings();
    public slots:
	void on_topicList_clicked(const QModelIndex & index);
	void on_articleList_clicked(const QModelIndex & index);
	void on_actionFresh_triggered();
	void on_actionReply_triggered();
	void updateList(bool error = false);
// 	void scrollTo(Topic * topic);
// 	void scrollTo(Article * article);
    private:
	ArticleList * articleList;
	MessageEdit * messageEdit;
	boardModel * bmodel;
// 	topicModel * tmodel;
	Board * board;
	static int instance;
};

#endif

